/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:48 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class CauhoiEntity
    {
        public CauhoiEntity()
        {
			m_pk_icauhoiid=0;
			m_snoidung="";
			m_idiem=0;
			m_dngaytao=DateTime.Now;
			m_dngaycapnhat=DateTime.Now;
			m_fk_idanhmuccauhoiid=0;
			m_fk_inguoitaoid=0;
			m_fk_inguoicapnhatid=0;
        }
		private Int64 m_pk_icauhoiid;
		public Int64 PK_iCauhoiID
		{
			get { return m_pk_icauhoiid ; }
			set { m_pk_icauhoiid = value; }
		}
		private String m_snoidung;
		public String sNoidung
		{
			get { return m_snoidung ; }
			set { m_snoidung = value; }
		}
		private Int16 m_idiem;
		public Int16 iDiem
		{
			get { return m_idiem ; }
			set { m_idiem = value; }
		}
		private DateTime m_dngaytao;
		public DateTime dNgaytao
		{
			get { return m_dngaytao ; }
			set { m_dngaytao = value; }
		}
		private DateTime m_dngaycapnhat;
		public DateTime dNgaycapnhat
		{
			get { return m_dngaycapnhat ; }
			set { m_dngaycapnhat = value; }
		}
		private Int16 m_fk_idanhmuccauhoiid;
		public Int16 FK_iDanhmuccauhoiID
		{
			get { return m_fk_idanhmuccauhoiid ; }
			set { m_fk_idanhmuccauhoiid = value; }
		}
		private Int64 m_fk_inguoitaoid;
		public Int64 FK_iNguoitaoID
		{
			get { return m_fk_inguoitaoid ; }
			set { m_fk_inguoitaoid = value; }
		}
		private Int64 m_fk_inguoicapnhatid;
		public Int64 FK_iNguoicapnhatID
		{
			get { return m_fk_inguoicapnhatid ; }
			set { m_fk_inguoicapnhatid = value; }
		}

        #region Comparison
        public static List<CauhoiEntity> Sort(List<CauhoiEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(CauhoiEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<CauhoiEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<CauhoiEntity> COMPARISON_PK_iCauhoiID
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.PK_iCauhoiID.CompareTo(other.PK_iCauhoiID);
				};
			}
		}
		public static Comparison<CauhoiEntity> COMPARISON_sNoidung
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.sNoidung.CompareTo(other.sNoidung);
				};
			}
		}
		public static Comparison<CauhoiEntity> COMPARISON_iDiem
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.iDiem.CompareTo(other.iDiem);
				};
			}
		}
		public static Comparison<CauhoiEntity> COMPARISON_dNgaytao
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.dNgaytao.CompareTo(other.dNgaytao);
				};
			}
		}
		public static Comparison<CauhoiEntity> COMPARISON_dNgaycapnhat
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.dNgaycapnhat.CompareTo(other.dNgaycapnhat);
				};
			}
		}
		public static Comparison<CauhoiEntity> COMPARISON_FK_iDanhmuccauhoiID
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.FK_iDanhmuccauhoiID.CompareTo(other.FK_iDanhmuccauhoiID);
				};
			}
		}
		public static Comparison<CauhoiEntity> COMPARISON_FK_iNguoitaoID
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.FK_iNguoitaoID.CompareTo(other.FK_iNguoitaoID);
				};
			}
		}
		public static Comparison<CauhoiEntity> COMPARISON_FK_iNguoicapnhatID
		{
			get
			{
				return delegate(CauhoiEntity entity,CauhoiEntity other)
				{
					return entity.FK_iNguoicapnhatID.CompareTo(other.FK_iNguoicapnhatID);
				};
			}
		}
        #endregion
    }
}
